using System;
using System.Threading;
using Nuwanda.TfsSpotlight.Shell.Services.Interfaces;
using StructureMap;

namespace Nuwanda.TfsSpotlight.Shell.Services
{
    [Pluggable("AsyncService")]
    public class AsyncService : IAsyncService
    {
        /// <summary>Invokes given action using thread pool</summary>
        /// <param name="action">Action to invoke</param>
        public void QueueInPool(Action action)
        {
            ThreadPool.QueueUserWorkItem(delegate { action(); });
        }
    }
}